$(document).ready(function() {
			// 初始化分页组件
			initPagination();
		});

// 初始化分页组件
function initPagination() {
	var num_entries = Number($("#totalItemsSize").val());
	var eachPageSize = Number($("#eachPageSize").val());
	var prePage = $("#page").val();
	if(prePage == null) {
		prePage = "1";
	}
	var current_page_val = 0;
	if (prePage > 1) {
		current_page_val = Number(prePage) - 1;
	}
	var totalPageVal = parseInt(num_entries / eachPageSize);
	if ((num_entries % eachPageSize) > 0) {
		totalPageVal = totalPageVal + 1;
	}
	if (current_page_val >= totalPageVal) {
		current_page_val = totalPageVal - 1;
	}
	if (num_entries > 0) {
		$("#Pagination").pagination(num_entries, {
					num_edge_entries : 1,
					num_display_entries : 6,
					callback : pageselectCallback,
					items_per_page : eachPageSize,
					current_page : current_page_val,
					prev_text : "上一页",
					next_text : "下一页"
				});
	}else{
		pageselectCallback(0, "Pagination");
	}
}

// 分页回调函数
function pageselectCallback(page_index, jq) {
	loadEachPageItemInfo(page_index + 1);
	return false;
}
